<template>
	<sc-dialog
		:title="titleMap[mode]"
		v-model="visible"
		:width="1500"
		destroy-on-close
		@closed="$emit('closed')"
	>
		<el-main class="nopadding">
			<scTable
				ref="table"
				:apiObj="apiObj"
				row-key="projectId"
				@selection-change="selectionChange"
				:params="search"
				stripe
			>
				<el-table-column
					label="#"
					type="index"
					width="50"
				></el-table-column>
				<el-table-column
					label="域名"
					prop="domainName"
				></el-table-column>
				<el-table-column
					label="解析记录状态"
					prop="status"
				></el-table-column>
				<el-table-column label="记录类型" prop="type"></el-table-column>
				<el-table-column
					label="解析记录ID"
					prop="recordId"
				></el-table-column>
				<el-table-column label="备注" prop="remark"></el-table-column>
				<el-table-column label="生存时间" prop="ttl"></el-table-column>
				<el-table-column label="主机记录" prop="rr"></el-table-column>
				<el-table-column
					label="负载均衡权重"
					prop="weight"
				></el-table-column>
				<el-table-column label="记录值" prop="value"></el-table-column>
			</scTable>
		</el-main>
	</sc-dialog>
</template>

<script>
export default {
	emits: ["success", "closed"],
	data() {
		return {
			mode: "show",
			titleMap: {
				show: "查看",
			},
			visible: false,
			isSaveing: false,
			apiObj: this.$API.domain.recordPage,
			selection: [],
			search: {
				appId: "",
				secret: "",
				key: "",
				endpoint: "",
			},
		};
	},
	mounted() {},
	methods: {
		//显示
		open(mode = "add") {
			this.mode = mode;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data) {
			this.search = data;
			//可以和上面一样单个注入，也可以像下面一样直接合并进去
			//Object.assign(this.form, data)
		},
	},
};
</script>

<style></style>
